package com.nineclock.approve.nodeResolver.impl;

import cn.hutool.json.JSONObject;
import com.nineclock.approve.nodeResolver.ProcessNodeResolver;
import org.activiti.bpmn.model.Process;
import org.activiti.bpmn.model.StartEvent;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
public class StartNodeResolver extends ProcessNodeResolver {

    @Override
    public void addFlowNodeToActiviti(Process process, JSONObject currNode, JSONObject nextNode) {
        StartEvent startEvent = new StartEvent();
        startEvent.setId(getNodeId(currNode)); // start_uuid
        startEvent.setName(currNode.getStr("name"));

        process.addFlowElement(startEvent);

        //绘制连线节点
        this.addSequenceFlowToActiviti(process, currNode, nextNode);

    }
}
